package interfaceDEMO.Utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @author wq
 * @since 2022-06-21 17:31
 */

public class InterfacePropertoes {
    public static String managersearchurl;
    public static String loginurl;
    public static String token;

    static {
        try {
            init();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
   private static void init() throws IOException {
        //加载配置文件为输入流。注意不要忘记斜杆
       InputStream inputStream = InterfacePropertoes.class.getResourceAsStream("/properties.properties");
       //new一个资源绑定类
       Properties properties = new Properties();
       //Properties类对象加载输入流
       properties.load(inputStream);
       //加载以后就可以根据配置文件键名拿值了getProperty()
       managersearchurl=properties.getProperty("managersearchurl");
       loginurl=properties.getProperty("loginurl");
   }
}
